package com.learn.pojo;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2025/02/23
 * @description 多对一测试
 * 多：学生类
 * 一：教师类
 * 多对一 多在前是主表
 * 一对多 一在前是主表
 */
public class Student {
    private Integer sid;
    private String sName;
    private Integer sAge;
    private Integer tid;
    // 因为是多对一，所以需要一个teacher属性封装
    private Teacher teacher;

    public Student() {
    }

    @Override
    public String toString() {
        return "Student{" +
                "sid=" + sid +
                ", sName='" + sName + '\'' +
                ", sAge=" + sAge +
                ", tid=" + tid +
                ", teacher=" + teacher +
                '}';
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    public Student(Integer sid, String sName, Integer sAge, Integer tid) {
        this.sid = sid;
        this.sName = sName;
        this.sAge = sAge;
        this.tid = tid;
    }

    public Integer getSid() {
        return sid;
    }

    public void setSid(Integer sid) {
        this.sid = sid;
    }

    public String getsName() {
        return sName;
    }

    public void setsName(String sName) {
        this.sName = sName;
    }

    public Integer getsAge() {
        return sAge;
    }

    public void setsAge(Integer sAge) {
        this.sAge = sAge;
    }

    public Integer getTid() {
        return tid;
    }

    public void setTid(Integer tid) {
        this.tid = tid;
    }
}
